<extend name="layout/main" />

<block name="HEADER">

</block>

<block name="CONTENT">
	<control:grid id="grid"  />

</block>


<block name="FOOTER">
	<script type="text/javascript">
		var page = (function(ns){



            //页面初始化
            ns.init=function(){

            }

            //显示详情
            ns.showBill = function (oid) {
                var filter = {
                    url:$.getModule('billInfo'),
                    mode:2,      //2编辑
                    oid:oid,
                }
                $.openIframe(filter,'开单记录详情',['900px', '85%']);
            };


            //选择用户
			ns.selectUsers = function(){
                var selectedRows = form.$grids['userGrid'].getRows();
                var str = $.map(selectedRows,function(h){ return h.id; }).join(',');

                var filter = {
                    url:"modules/common/selectUserCore",
                    mode:1,
                    id:str

                }
                $.openIframe(filter,"选择会员",['700px', '480px']);

			}

            //用户行 - 删除
            ns.deleteUser = function(){
                form.$grids['userGrid'].deleteRow();
            }

            ns.tobill =function(e){

                var filter = {
                    url:$.getModule('edit'),
                    mode:2,
                    oid:"",
					type:e

                }
                var type_name;
                if(e==1){
                    type_name="普通类开单";
				}else if(e==2){
                    type_name="服务类开单";
				}else if(e==3){
                    type_name="套餐类开单";
				}

                $.openIframe(filter,type_name,['900px', '85%']);

			}


		    return ns;
		}({}));
		
	</script>
</block>